package net.wofly.cashier.reservation.util;

/**
 * 预约状态
 * @author lign
 * @version 1.0
 * @created 17-十月-2017 23:09:08
 */
public enum ReservationStatus {
	预约成功(1, "预约成功"),
	就餐(2, "就餐"),
	取消(0, "取消"),
	未就餐(-1, "未就餐");

	private Integer value;
	private String name;

	private ReservationStatus(Integer value, String name) {
		this.value = value;
		this.name = name;
	}

	public static boolean isValueCorrect(Integer value) {
		for (ReservationStatus forEnum : values()) {
			if (value == forEnum.getValue()) {
				return true;
			}
		}
		return false;
	}

	public static String getName(Integer value) {
		for (ReservationStatus forEnum : values()) {
			if (value.equals(forEnum.getValue())) {
				return forEnum.name;
			}
		}
		return null;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}
}